<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="createOrEditModal" aria-hidden="true" [config]="{ backdrop: 'static' }">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <form *ngIf="active" #roleForm="ngForm" novalidate (ngSubmit)="save()" autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span *ngIf="coderule_id">修改-规则选项</span>
                        <span *ngIf="!coderule_id">新建-规则选项</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="col-sm-9">
                        <div class="form-group">
                            <label for="f_RuleCode">规则编号<span style="color:red">*</span></label>
                            <input id="f_RuleCode" #nameInput="ngModel" class="form-control" type="text" name="f_RuleCode"
                                [(ngModel)]="coderule.f_RuleCode" required maxlength="32" />
                            <validation-messages [formCtrl]="nameInput"></validation-messages>
                        </div>
                        <div class="form-group">
                            <label for="f_RuleName">规则名称<span style="color:red">*</span></label>
                            <input id="f_RuleName" #nameInput="ngModel" class="form-control" type="text" name="f_RuleName"
                                [(ngModel)]="coderule.f_RuleName" required />
                            <validation-messages [formCtrl]="nameInput"></validation-messages>
                        </div>
                        <div class="col-md-6">
                            <label for="f_Type">类型<span style="color:red">*</span></label>
                            <select #deptitemsCombobox (change)="getTypeName($event)" name="f_Type" class="form-control" [(ngModel)]="coderule.f_Type" [attr.data-live-search]="true" required>
                               <option *ngFor="let deptitem of deptitems" [value]="deptitem.value" [title]="deptitem.displayText">{{deptitem.displayText}}</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="f_Formate">格式 </label>
                            <input id="f_Formate" #nameInput="ngModel" class="form-control" type="text" name="f_Formate"
                                [(ngModel)]="coderule.f_Formate"  />
                        </div>
                        <div class="form-group">
                            <label for="f_Length">流水号长度 </label>
                            <input id="f_Length" #nameInput="ngModel" class="form-control" type="text" name="f_Length"
                                [(ngModel)]="coderule.f_Length"   />
                        </div>
                        <div class="form-group">
                            <label for="f_MinValue">最小值 </label>
                            <input id="f_MinValue" #nameInput="ngModel" class="form-control" type="text" name="f_MinValue"
                                [(ngModel)]="coderule.f_MinValue"  />
                        </div>
                        <div class="form-group">
                            <label for="f_MaxValue">最大值 </label>
                            <input id="f_MaxValue" #nameInput="ngModel" class="form-control" type="text" name="f_MaxValue"
                                [(ngModel)]="coderule.f_MaxValue"   />
                        </div>
                         <div class="form-group">
                            <label for="f_NextCode">下一个流水号 </label>
                            <input id="f_NextCode" #nameInput="ngModel" class="form-control" type="text" name="f_NextCode"
                                [(ngModel)]="coderule.f_NextCode"   />
                        </div>
                        <div class="form-group">
                            <label for="f_Remark">备注 </label>
                            <input id="f_Remark" #nameInput="ngModel" class="form-control" type="text" name="f_Remark"
                                [(ngModel)]="coderule.f_Remark"   />
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-secondary" (click)="close()">
                       取消
                    </button>
                    <button type="submit" class="btn btn-primary" [disabled]="!roleForm.form.valid" [buttonBusy]="saving"
                        [busyText]="l('SavingWithThreeDot')">
                        <i class="fa fa-save"></i> <span>确定</span>
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>